package com.cml.dm.engine.annoations;

import com.cml.dm.engine.context.DmContext;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

public class DmEngineInit implements ImportBeanDefinitionRegistrar {
    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
        String metaFileName = (String) importingClassMetadata.getAnnotationAttributes(EnableDmEngine.class.getName()).get("value");
        if(metaFileName != null){
            DmContext.DM_META_FILE_NAME = metaFileName;
        }
    }
}
